/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.com.compassion.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/** Clase entidad para el mapeo de tabla de base de datos Asociacion
* @author grupo de Tesis
*/
@Entity
@Table(name = "asociacion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Asociacion.findAll", query = "SELECT a FROM Asociacion a"),
    @NamedQuery(name = "Asociacion.findByIdcdiAso", query = "SELECT a FROM Asociacion a WHERE a.idcdiAso = :idcdiAso"),
    @NamedQuery(name = "Asociacion.findByFecIniAsociacion", query = "SELECT a FROM Asociacion a WHERE a.fecIniAsociacion = :fecIniAsociacion"),
    @NamedQuery(name = "Asociacion.findByFecFinAsociacion", query = "SELECT a FROM Asociacion a WHERE a.fecFinAsociacion = :fecFinAsociacion"),
    @NamedQuery(name = "Asociacion.findByAuAddUsr", query = "SELECT a FROM Asociacion a WHERE a.auAddUsr = :auAddUsr"),
    @NamedQuery(name = "Asociacion.findByAuAddDat", query = "SELECT a FROM Asociacion a WHERE a.auAddDat = :auAddDat"),
    @NamedQuery(name = "Asociacion.findByAuModUsr", query = "SELECT a FROM Asociacion a WHERE a.auModUsr = :auModUsr"),
    @NamedQuery(name = "Asociacion.findByAuModDat", query = "SELECT a FROM Asociacion a WHERE a.auModDat = :auModDat")})
public class Asociacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_cdiAso")
    private Integer idcdiAso;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecIniAsociacion")
    @Temporal(TemporalType.DATE)
    private Date fecIniAsociacion;
    @Column(name = "fecFinAsociacion")
    @Temporal(TemporalType.DATE)
    private Date fecFinAsociacion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddUsr")
    private int auAddUsr;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddDat")
    @Temporal(TemporalType.DATE)
    private Date auAddDat;
    @Column(name = "AuModUsr")
    private Integer auModUsr;
    @Column(name = "AuModDat")
    @Temporal(TemporalType.DATE)
    private Date auModDat;
    @JoinColumn(name = "idEmpleado", referencedColumnName = "idEmpleado")
    @ManyToOne(optional = false)
    private Empleado idEmpleado;
    @JoinColumn(name = "idCdi", referencedColumnName = "idCdi")
    @ManyToOne(optional = false)
    private Cdi idCdi;

    public Asociacion() {
    }

    public Asociacion(Integer idcdiAso) {
        this.idcdiAso = idcdiAso;
    }

    public Asociacion(Integer idcdiAso, Date fecIniAsociacion, int auAddUsr, Date auAddDat) {
        this.idcdiAso = idcdiAso;
        this.fecIniAsociacion = fecIniAsociacion;
        this.auAddUsr = auAddUsr;
        this.auAddDat = auAddDat;
    }

    public Integer getIdcdiAso() {
        return idcdiAso;
    }

    public void setIdcdiAso(Integer idcdiAso) {
        this.idcdiAso = idcdiAso;
    }

    public Date getFecIniAsociacion() {
        return fecIniAsociacion;
    }

    public void setFecIniAsociacion(Date fecIniAsociacion) {
        this.fecIniAsociacion = fecIniAsociacion;
    }

    public Date getFecFinAsociacion() {
        return fecFinAsociacion;
    }

    public void setFecFinAsociacion(Date fecFinAsociacion) {
        this.fecFinAsociacion = fecFinAsociacion;
    }

    public int getAuAddUsr() {
        return auAddUsr;
    }

    public void setAuAddUsr(int auAddUsr) {
        this.auAddUsr = auAddUsr;
    }

    public Date getAuAddDat() {
        return auAddDat;
    }

    public void setAuAddDat(Date auAddDat) {
        this.auAddDat = auAddDat;
    }

    public Integer getAuModUsr() {
        return auModUsr;
    }

    public void setAuModUsr(Integer auModUsr) {
        this.auModUsr = auModUsr;
    }

    public Date getAuModDat() {
        return auModDat;
    }

    public void setAuModDat(Date auModDat) {
        this.auModDat = auModDat;
    }

    public Empleado getIdEmpleado() {
        return idEmpleado;
    }

    public void setIdEmpleado(Empleado idEmpleado) {
        this.idEmpleado = idEmpleado;
    }

    public Cdi getIdCdi() {
        return idCdi;
    }

    public void setIdCdi(Cdi idCdi) {
        this.idCdi = idCdi;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcdiAso != null ? idcdiAso.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Asociacion)) {
            return false;
        }
        Asociacion other = (Asociacion) object;
        if ((this.idcdiAso == null && other.idcdiAso != null) || (this.idcdiAso != null && !this.idcdiAso.equals(other.idcdiAso))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.compassion.entidades.Asociacion[ idcdiAso=" + idcdiAso + " ]";
    }
    
}
